package com.tinem.platform.web.auth.grant.client_credentials_user;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.SpringSecurityCoreVersion;

/**
 * @author fzh
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class ClientCredentialsUserAuthenticationToken extends AbstractAuthenticationToken {

	private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;

	private String clientId;
	private String id;
	private String ip;
	private Object principal;

	public ClientCredentialsUserAuthenticationToken( String clientId,String id,String ip) {
		super(null);
		this.clientId = clientId;
		this.id = id;
		this.ip = ip;
		setAuthenticated(false);
	}

	@Override
	public Object getPrincipal() {
		return this.principal;
	}
	
	@Override
	public Object getCredentials() {
		return null;
	}

	@Override
	public void eraseCredentials() {
		super.eraseCredentials();
	}

}